// app.js
App({
	request(obj) { //obj={ url, timeout, }
		return new Promise((resolve, reject) => {
			wx.request({ //发起请求
				...obj,
				complete: r => { //执行结果
					if (r.errMsg == 'request:ok' && r.data != null) { //成功获得数据
						resolve(r.data)
					} else { //否则，返回null
						resolve(null)
					}
				}
			})
		})
	}
})